package com.loong.coupon.common.backend.param;

import com.loong.common.validator.group.CommonInsert;
import com.loong.common.validator.group.CommonUpdate;
import lombok.*;

import javax.persistence.Column;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class CouponApplyRuleParam {

    /**
     * 主键id
     */
    @NotNull(message = "更新时不能id不能为空",groups = {CommonUpdate.class})
    private Long id;

    /**
     * 优惠券id
     */
    private Long couponId;

    /**
     * 规则名称
     */
    @NotBlank(message = "新增时规则名称不能为空",groups = {CommonInsert.class})
    private String ruleName;

    /**
     * 规则值(0则表示所有,多个值之间用英文逗号隔开)
     */
    @NotBlank(message = "新增时规则值不能为空",groups = {CommonInsert.class})
    private String ruleValue;

    /**
     * 规则类型(1适用用户,2适用类型,3适用平台)
     */
    @NotNull(message = "新增时规则类型不能为空",groups = {CommonInsert.class})
    @DecimalMin(value = "1",groups = {CommonInsert.class})
    private Integer ruleType;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date lastUpdateTime;
}